﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MvvmFoundation.Wpf;

namespace WpfApplication4
{
    public class MainWindowViewModel:ViewModel
    {
        private ObservableObject _mainPanel;

        public MainWindowViewModel()
        {
            Commands = new Collection<CommandViewModel>();
            Commands.Add(new CommandViewModel { Command = new RelayCommand(ExecuteA), DisplayText = "A" });
            Commands.Add(new CommandViewModel { Command = new RelayCommand(ExecuteB), DisplayText = "B" });
            Commands.Add(new CommandViewModel { Command = new RelayCommand(ExecuteC), DisplayText = "C" });
        }

        private void ExecuteA()
        {
            MainPanel=new ViewModelA();
        }

        private void ExecuteB()
        {
            MainPanel=new ViewModelB();
        }

        private void ExecuteC()
        {
            MainPanel=new ViewModelC();
        }

        public Collection<CommandViewModel> Commands { get; private set; }

        public ObservableObject MainPanel
        {
            get { return _mainPanel; }
            private set
            {
                _mainPanel = value;
                RaisePropertyChanged("MainPanel");
            }
        }

    }
}
